// 复用工具
/**
 *
 * @param {*} obj
 * @param {*} type
 */
//包装成一个高阶函数 批量生成函数
export function isType(type) {
  return function(obj) {
    return Object.prototype.toString.call(obj).includes(type)
  }
}
let types = ["String", "Number", "Boolean", "Object", "Array", "Null", "Undefined", "symbol"]
let fns = {}
types.forEach(type => {
  fns["is" + type] = isType(type)
})
